package com.dfbz.springboot_project.entity;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import java.sql.Timestamp;
import java.util.Date;
import java.util.Objects;

@Entity
public class Cost {
    private Integer costId;
    private String costName;
    private Integer costBaseDuration;
    private Double costBaseCost;
    private Double costUnitCost;
    private String costStatus;
    private String costDescr;
    private Date costCreattime;
    private Date costStarttime;
    private String costType;



    @Id
    @Column(name = "cost_id", nullable = false)
    public Integer getCostId() {
        return costId;
    }

    public void setCostId(Integer costId) {
        this.costId = costId;
    }

    @Basic
    @Column(name = "cost_name", nullable = false, length = 50)
    public String getCostName() {
        return costName;
    }

    public void setCostName(String costName) {
        this.costName = costName;
    }

    @Basic
    @Column(name = "cost_base_duration", nullable = true)
    public Integer getCostBaseDuration() {
        return costBaseDuration;
    }

    public void setCostBaseDuration(Integer costBaseDuration) {
        this.costBaseDuration = costBaseDuration;
    }

    @Basic
    @Column(name = "cost_base_cost", nullable = true, precision = 2)
    public Double getCostBaseCost() {
        return costBaseCost;
    }

    public void setCostBaseCost(Double costBaseCost) {
        this.costBaseCost = costBaseCost;
    }

    @Basic
    @Column(name = "cost_unit_cost", nullable = true, precision = 4)
    public Double getCostUnitCost() {
        return costUnitCost;
    }

    public void setCostUnitCost(Double costUnitCost) {
        this.costUnitCost = costUnitCost;
    }

    @Basic
    @Column(name = "cost_status", nullable = true, length = 1)
    public String getCostStatus() {
        return costStatus;
    }

    public void setCostStatus(String costStatus) {
        this.costStatus = costStatus;
    }

    @Basic
    @Column(name = "cost_descr", nullable = true, length = 100)
    public String getCostDescr() {
        return costDescr;
    }

    public void setCostDescr(String costDescr) {
        this.costDescr = costDescr;
    }



    @Basic
    @Column(name = "cost_creattime", nullable = true)
    public Date getCostCreattime() {
        return costCreattime;
    }

    public void setCostCreattime(Date costCreattime) {
        this.costCreattime = costCreattime;
    }



    @Basic
    @Column(name = "cost_starttime", nullable = true)
    public Date getCostStarttime() {
        return costStarttime;
    }

    public void setCostStarttime(Date costStarttime) {
        this.costStarttime = costStarttime;
    }
    @Basic
    @Column(name = "cost_type", nullable = false, length = 1)
    public String getCostType() {
        return costType;
    }

    public void setCostType(String costType) {
        this.costType = costType;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Cost cost = (Cost) o;
        return costId == cost.costId &&
                Objects.equals(costName, cost.costName) &&
                Objects.equals(costBaseDuration, cost.costBaseDuration) &&
                Objects.equals(costBaseCost, cost.costBaseCost) &&
                Objects.equals(costUnitCost, cost.costUnitCost) &&
                Objects.equals(costStatus, cost.costStatus) &&
                Objects.equals(costDescr, cost.costDescr) &&
                Objects.equals(costCreattime, cost.costCreattime) &&
                Objects.equals(costStarttime, cost.costStarttime) &&
                Objects.equals(costType, cost.costType);
    }

    @Override
    public int hashCode() {
        return Objects.hash(costId, costName, costBaseDuration, costBaseCost, costUnitCost, costStatus, costDescr, costCreattime, costStarttime, costType);
    }
}
